package com.sky.mapper.common;

import com.sky.pojo.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description DishFlavorMapper
 * @Author lijingtong
 * @Date 2024-09-27
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 批量插入口味数据
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据主键删除菜品口味
     * @param ids
     */
    void deleteByDishIds(@Param("ids") List<Long> ids);


    /**
     * 删除原有数据
     * @param id
     */
    void deleteByDishId(Long id);

    void bathcSave(List<DishFlavor> flavors);

    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> getByDishId(Long id);
}
